package com.allenkerr.dao;

import com.allenkerr.model.Book;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

import java.util.List;

public interface BookRepository extends ElasticsearchRepository<Book, String>, BookRepositoryCustom {

    Page<Book> findByAuthor(String author, Pageable pageable);

    List<Book> findByTitle(String title);

    List<Book> findByTitleIsLike(String title);         //从头开始匹配
    List<Book> findByTitleContains(String title);       //包含
    List<Book> findByTitleContaining(String title);     //包含

    List<Book> findByTitleIsNear(String title);         //不知道怎么用

}